<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SUOYUEの热门文章</title>

    <!--浏览器导航栏图标-->
    <link rel="shortcut icon" th:href="@{/images/favicon.ico}" />
	<!--引入semantic-ui的CDN-->
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
    <link rel="stylesheet" href="../../static/lib/editormd/css/editormd.min.css" th:href="@{/lib/editormd/css/editormd.min.css}">
    <link rel="stylesheet" href="../static/css/me.css" th:href="@{/css/me.css}">
    <link rel="stylesheet" href="../static/css/me3d.css" th:href="@{/css/me3d.css}">
</head>


<body>
<!--导航栏-->
<nav class="ui inverted gird-header" >
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui olive header item" style="font-family: STSong">SUOYUE</h2>
            <a href="#" th:href="@{/}" class="m-item item m-mobile-hide"><i class="home icon"></i><span th:text="#{index.home}">首页</span></a>
            <a href="#" th:href="@{/hotArticle}" class="active m-item item m-mobile-hide"><i class="clone outline icon"></i><span th:text="#{index.hotArticle}">热门文章</span></a>
            <a href="#" th:href="@{/newArticle}" class="m-item item m-mobile-hide"><i class="clock icon"></i><span th:text="#{index.time}">时间轴</span></a>
            <a href="#" th:href="@{/activeUser}" class="m-item item m-mobile-hide"><i class="clone outline icon"></i><span th:text="#{index.user}">活跃好友</span></a>
            <a href="#" th:href="@{/message}" class="m-item item m-mobile-hide"><i class="book icon"></i><span th:text="#{index.messages}">留言板</span></a>
<!--            <a href="#" th:href="@{/echarts}" class="m-item item m-mobile-hide"><i class="clone outline icon"></i><span th:text="#{index.map}">疫情地图</span></a>-->
            <!--  创作中心  -->
            <h5 class="m-item item m-mobile-hide" style="font-family: STSong"><a href="#" th:href="@{/user/index}" class="ui inverted green rounded button" ><i class="edit icon"></i>创作中心</a></h5>
            <!--  用户头像  -->
            <div class="left m-item m-mobile-hide menu" th:if="${session.user}">
                <div class="ui dropdown item">
                    <div class="text">
                        <img class="ui avatar image" src="../../static/images/me.jpg" th:src="${session.user.avatar}">
                    </div>
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a href="" th:href="@{/logout}" class="item">注销</a>
                    </div>
                </div>
            </div>
            <!--  搜索栏  -->
            <div class="right m-item item m-mobile-hide">
                <form name="search" action="#" th:action="@{/search}" method="post" target="_blank">
                    <div class="ui icon transparent input m-margin-tb-tiny" style="color: white">
                        <input style="color: white" type="text" name="query" placeholder="Search....">
                        <i onclick="document.forms['search'].submit()" class="search link icon"></i>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <!--手机端收起导航栏-->
    <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>

<!--顶部图片-->
<div class="m-bg-type_outer" style="width: 100%;height: 36%">
    <img src="../static/images/typebg.jpg" th:src="@{/images/typebg.jpg}" alt="" class="ui m-bg image" style="width: 100%;height: 100%">
    <div class="m-bg-class_cover">
        <div class="ui container" style="position: relative ;bottom: -590px;">
            <div class="m-font-size-title m-right-bottom" align="center" style="font-family:'STXingkai'">热门文章</div>
            <div class="m-font-size-text-init-title m-margin-top" align="center">记忆是一种相聚的方式，放下是一种自由的形式。不必悲伤，不必忧愁，邂逅的回忆都是美好的故事</div>
        </div>
    </div>
</div>

<!--热门文章-->
<div class="m-padded-tb animated fadeIn">
    <div class="ui container">
        <div class="ui stackable grid">
            <!--博客内容-->
            <div class="ui vertical segment">
                <!--博文列表-->
                <div class="ui padded segment m-padded-tb-large m-opacity" th:each="page: ${pageInfo}">
                    <!-- mobile reversed:手机端翻转下列两个div模块-图片先显示/内容后显示-->
                    <div class="ui large aligned mobile reversed stackable grid">
                        <!--博文信息-->
                        <div class="eleven wide column" >
                            <h3 class="ui header" ><a href="#" th:href="@{/blog/{id}(id=${page.id})}" target="_blank" class="m-black" th:text="${page.title}">大圣，此去欲何?</a></h3>
                            <p class="m-text m-margin-top-max" th:text="${page.description}">戴上金箍，没法爱你；放下金箍，没法保护你。我知道上天不会给我第二次机会，曾经我们说好的永远，原来也仅仅只有，十二画，而已。“大圣，此去欲何?”“踏南天，碎凌霄。”“若一去不回……”“便一去不回” 其实很多时候，我们都是有机会的，最后真正放弃的，是我们自己。......</p>
                            <div class="ui m-margin-top-max grid">
                                <div class="eleven wide column">
                                    <div class="ui mini horizontal link list">
                                        <div class="item">
                                            <img  src="../static/images/me.jpg" th:src="${page.avatar}" alt="" class="ui avatar image">
                                            <div class="content"><a href="#" th:href="@{/oneUser/-1/{id}(id=${page.userId})}" target="_blank" class="header" th:text="${page.username}" >oneStar</a></div>
                                        </div>
                                        <div class="item">
                                            <i class="calendar icon"></i><span th:text="${#dates.format(page.updateTime,'yyyy-MM-dd HH:mm:ss')}">2020-01-01</span>
                                        </div>
                                        <div class="item">
                                            <i class="eye icon"></i> <span th:text="${page.views}">2222</span>
                                        </div>
                                        <div class="item">
                                            <i class="comment outline icon"></i> <span th:text="${page.commentCount}">2222</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="right aligned five wide column">
                                    <a href="#" class="ui teal basic label m-padded-tiny m-text-thin" th:text="${page.typeName}">好文</a>
                                </div>
                            </div>
                        </div>
                        <!--博文图片-->
                        <div class="five wide column">
                            <a href="#" th:href="@{/blog/{id}(id=${page.id})}" target="_blank">
                                <img src="../static/images/backimg1.jpg" th:src="${page.firstPicture}" alt="" class="ui rounded image">
                            </a>
                        </div>

                    </div>
                </div>
            </div>
            <!--分页-->
            <div class="ui bottom attached segment m-opacity stackable grid">
                <div class="three wide column" align="center">
                    <a class="item" th:href="@{/hotArticle/(pageNum=${pageInfo.pageNum}-1)}">上一页</a>
                </div>

                <div class="ten wide column" align="center">
                    <p> <span th:text="${pageInfo.pageNum}"></span> / <span th:text="${pageInfo.pages}"></span> </p>
                </div>

                <div class="three wide column" align="center">
                    <a class="item" th:href="@{/hotArticle/(pageNum=${pageInfo.pageNum}+1)}">下一页</a>
                </div>
            </div>
        </div>
    </div>
</div>


<br>
<br>
<br>

<!--右下角-侧边栏-->
<div id="toolbar" class="m-padded m-fixed m-right-bottom" style="display: none">
    <div class="ui vertical icon buttons ">
        <div id="toTop-button" class="ui icon button" ><i class="chevron up icon"></i></div>
    </div>
</div>

<!--底部栏-->
<footer class="ui inverted vertical segment m-padded-tb-massive m-opacity" th:replace="_fragments :: footer">

</footer>

<!--通用script：使用div标签或thymeleaf模板的th:block-->
<th:block th:replace="_fragments :: script">

</th:block>

<script src="//cdn.jsdelivr.net/npm/jquery.scrollto@2.1.2/jquery.scrollTo.min.js"></script>
<script src="../static/lib/waypoints/jquery.waypoints.min.js" th:src="@{/lib/waypoints/jquery.waypoints.min.js}"></script>

<script>

    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-show');
    });

    $('.ui.dropdown').dropdown({
        on : 'hover'
    });

    //右下角点击滚上去事件
    $('#toTop-button').click(function () {
        $(window).scrollTo(0,500);
    });
    //滚动侦测
    var waypoint = new Waypoint({
        element: document.getElementById('waypoint'),
        handler: function(direction) {
            if (direction == 'down') {
                $('#toolbar').show(100);
            } else {
                $('#toolbar').hide(500);
            }
            console.log('Scrolled to waypoint!  ' + direction);
        }
    })
</script>


<!--看板娘-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css">
<script src="https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget/autoload.js"></script>

</body>
</html>